package cn.boyu.service.impl;

import cn.boyu.entity.SysDictData;
import cn.boyu.mapper.SysDictDataMapper;
import cn.boyu.result.AssertUtil;
import cn.boyu.service.ISysDictDataService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author yn
 * @since 2022-11-22
 */
@Service
public class SysDictDataServiceImpl extends ServiceImpl<SysDictDataMapper, SysDictData> implements ISysDictDataService {

    @Override
    public List<SysDictData> getType(String dictType, Integer value) {
        AssertUtil.hasLength(dictType,"类型不能为空");
        QueryWrapper<SysDictData> qw = new QueryWrapper<>();
        qw.eq("dict_type",dictType);
        qw.eq(value!=null,"dict_value",value);
        return list(qw);
    }
}
